Added null checks on the Value.as-methods, since Value.object now can be null