Fix compilation issues: compile msg before plugin