Don't try closing something that doesn't exist

Fixes #27