Fix const-related compiler errors