Fix invalid state on server crash. Fixes #2