App now stops properly.