Fixed filter error in mobile browsers. Small fixes and optimisations.

Thanks to MaxKorz for some ideas.