Fixing wrong code generated when comparing variables with null, fix memory_observe call