Corrected casted types

Changes according to discussion of #13