Fixed logical bug in mapEquals method