Add the correct c++ cast