BugFix for val = null (was working anyway, but ugly...)