Fix #65. Check entry exists before accessing value.

This fixes #65, which was introduced by e4e053e4248b8f3165c8cb6dba4820390b57ca84.