Fixed readFrame