Fixed compile errors of M5.