manually apply #277 patch