Added cast to avoid an _horrible_ GCC warning when building