Fix bytestr pass to calcLength

Fix exception caused by passing bytestr instead of str to calcLength.
Was causing exception on the first config value and an “empty” config
to be return in python 2.7