Updating codeGen with logic fix and simpler nil checking