Fix popup styling, fix magnic popup infinite loop and double-popups bugs