Add masking key to close. Fixes #21.