Fixes #1, haskey deprecation warning