Added array validation functions; resolves #2.