Fixed bug in compare method for avg option