Fix a compile error and squash reflection warnings