fix compilation with newer version of *mm and gcc-6.2 (RefPtr<> cast)