Provide suitable error message for build indexes that are out of bounds (#121)

PR is attempting to patch #121
This is not a class but a method.  Also please to get the comment into a single line, so we have a single-line docstring.