Fixes for proper "has_key" checking