Fixed bug when detecting mobile devices

Previously was incorrectly returning false when it found a mobile device.