Use nearbyint instead of round to comply with LabVIEW rounding

Also use the MAXAVERAGE constant everywhere, not only in the sequence
library but also in main