bugfix: invalid fread length