Added a few short-circuit when giving empty arrays as parameters. A lot are still missing.