This reverts commit 8abe7b11f7. Added the missing cast which was causing a build problem on certain compilers.
8abe7b11f7