Fix code generation with leafrefs pointing to optional members