Fixed popover bug, and got rid of jshint issues