Fix modello model version
Be careful when unboxing Boolean that can be null

Add explicit check for null value when unboxing Booleans that can be
null.  Also extract duplicated code to a utility class.