Solve a couple of issues with OnEventWrapper generated code and imports