Fix issue related to null in code generator