added bounds check for getter methods that accept an index, fixed #16