If your client closes ungracefully, this can happen. And by the way, just closing the client window doesn't shut it down - you have to actually exit the program.
Clients can close ungracefully in a few ways. For example, if you kill it via task manager, power loss, force shut down, or if you have disabled the "close gracefully" setting if it exists.
Bonus points don't have anything to do with the cause, but the cause for both issues are somewhat related.