Added const where possible.