fix bug introduced by
https://github.com/nuvolabase/orientdb/commit/dee9f205dea706ddf009e402632871a780326e61
as code never reaches second if clause. Now is expected to consider both
parameters as collection and collection in each item
fix for a test case found executing the test suite
Merge pull request #1463 from pellyadolfo/master

fix for max/min functions