Fix a bug and relax the error threshold - all output tests passed