Fixed class cast exceptions on int, long, short premitives as well as
null pointer with null maps