Some minor changes (added 'const' where needed).