remove debug and correct some fseeks.