fixed some problems with boxed/unboxed primitives (e.g. assuming that an int is a double is okay, but assuming that a java.lang.Integer is a java.lang.Double is wrong)