Fixed some issues with const usage.