Fixed incorrect cast caught by clang