Casting bug in mapper