Check for the existence of the key. Fixes #611.