Fixed casting issue

Linked with dandelion/issues#81