Unsafe key enumeration

This should resolve #103, still not sure quite how this was being caused as I couldn't replicate it. The guard should fix it though.