Slight simplification of map layer code