Bugfix: local variable shadowed proper variable.
Warning removal: const on return types not needed.
Merge pull request #141 from atgeirr/master

Fix warnings