Various fixes

1) Fixed mistake that was most likely a typo, which might lead to NullPointerException.
2) Removed Boolean constructor invocations. Creating new instances of java.lang.Boolean using new Boolean() wastes memory, since Boolean objects are immutable and there are only two useful values of this type.
Fixed this by removing call to new Boolean() constructor and letting autoboxing do its job (compiler will translate this to Boolean.valueOf() which reuse the 2 public static final constants Boolean.TRUE and Boolean.FALSE)