Fixing some bugs after upgrading to angularjs 1.3.4 ($locationProvider.html5Mode)