Fixes problems with const qualifier

Issue: #46