Added and tested proper exception handling concerning array shape