Save map fix

Fixed saving of layered maps.