Fixed various NPEs related to the Mapper