Correct bug in saving number of records #166