Switched to safe dictionary lookup methods

Fixes #10