Fixed a bug; app_file was called before being defined.