bug fixes

Fixes 1-off bug in generate() and getone() regarding argument 'limit'. String length was allowed to be limit + 1 instead of limit 1.