Fixes viewport issues and swipe bugs

This fixes some viewport related bugs introduced in #1371 and a reload issue in swipenav.js