Improved map parsing