Fixing code gen, adding new error logging
Merge remote-tracking branch 'origin/master'