Fix problem when deleting machine applications

Closes #27