Fixed errors on emitting enums. Added forgotten todo