Remove compile warnings.
Remove redundant casts.
Merge pull request #188 from greboid/tidying

Remove compile warnings.