Improved packed app detection

Closes #329