Add more NullReference checks in compiler.