Add tests for updateMap and fix bug when it deletes all attributes