Made references const to fix compile error with gcc