Cleaned up attributeMap save function.