Corrected error with maxprod