don't throw errors when a variable was declared and defined at the same time
fix some bits in code generator for compatibility