Fixes #135. Fix ClassClastException when there is a handler for
Map.class.