Respond appropriately when application is brought down

Fixes #561

Signed-off-by: Ryan O'Hara <oharar@email.chop.edu>