Fixed bug with map returning nils