Implemented min and max for arrays
A bit nice error message