Small fix to casting