Improved error messages and unit tests in BaseGroupedMapper, fixed CS

Fixed tests for php 5.3