Add tests for empty and 1-length arrays. Also add some checks