Adding static_cast to keep the compiler happy