Fixing an issue with the contextmenu popping up. Also correcting the
isMobile flag's determination.