Fixed logic errors in Map.update()