Improves exception message when offset is invalid