Fix issue with thrown exceptions on edge cases
Fix issue with thrown exceptions on edge cases

Return DimensionError when `sizes = []` and a TypeError if either type
presented is incorrect.

josdejong/mathjs,FSMaxB/mathjs,FSMaxB/mathjs,josdejong/mathjs,FSMaxB/mathjs,josdejong/mathjs,FSMaxB/mathjs,FSMaxB/mathjs,josdejong/mathjs,josdejong/mathjs