Fix error when generating random binary strings