Fix crash on open. (See #3.)