-fix crash when deleting final key in wallet