Fix crashes when unknown map items (fixes #305)