Update App.php

Fix a few bugs.