Removed magic numbers and fixed const modifiers.