Fix bugs when running with USE_CODEGEN_DISCOVERY
Fix bugs when running with USE_CODEGEN_DISCOVERY

Summary: Changelog: [internal] Fixing a couple of bugs when running with USE_CODEGEN_DISCOVERY.

Reviewed By: mdvacca

Differential Revision: D33115937

fbshipit-source-id: bb770b406b6dbebfefccac488a7c40caaafa6ca6

javache/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,janicduplessis/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,facebook/react-native,facebook/react-native,janicduplessis/react-native,janicduplessis/react-native,javache/react-native,javache/react-native,facebook/react-native,javache/react-native,javache/react-native,javache/react-native,janicduplessis/react-native,facebook/react-native,facebook/react-native,facebook/react-native,janicduplessis/react-native,janicduplessis/react-native,javache/react-native,facebook/react-native