Tweaks to app.php
Fix #1377