Issue 5 typecast

Fixes #5