Fix the solution for 'max' implementation, use the first element value as default instead of 0.