Fix broken references to widgets and make template IE friendly