Bugfix and generalize tock length