toString error cleanup

Adds an error for when you pass an out of range base, instead of segfaulting.