Cleaned up code, bugfix with using regex

Did 3 things:

* Fixed bug with using regex to get the bare app names
* Exit status
* List comprehension use to write to file

More details inside the commit.