Cast error on Linux, corrected