Improved the array bounds checking and updated the copyright.