I do not agree with the changes made in this function.  `nregisters` is intended to indicate the total storage required.