Fixed a few bugs related to app tests