Fixed issues with nullpointerexception in MapHandler