Code cleanup.
Added const's and referances if needed.