Move notify out of transaction
Refactor code in StopLoader
Fix delete query: delete selection (_id != -1)