fix casting of maxrecords (#230)