AMF - fixed codegen issues