Temporarily fixed an issue with popover not popping at the right position. Credits: http://stackoverflow.com/a/22459917/1251031 (if that did anything) and  http://stackoverflow.com/a/12656175/1251031 (semi-auto positioning)