Merge "Don't pad before calling writeInPlace()." into pi-dev