fix wrong unnecessary downcast
Merge pull request #506 from CJentzsch/bugfix

fix wrong unnecessary downcast