Fixed regression in feature pyramids due to rounding errors. Code is ugly as hell but it works.