Location: fix handle type detection for mapped IDs