Fix variable reference
Remove duplication
Ensure environment file exists if app exists
Better messaging