Fix cast

See #42 where merge was not as expected.
Merge pull request #43 from tbeu/fix-const-cast

Fix cast