Fix useless references and misplace consts