Fix small bugs with map