Fixed mistakenly adjusting size of wrong buffer in last commit