Bug fix

- For some design, the length can be equal to zero. In such case, the
variable tmp should not be set to zero. This is fixed by changing the
condition “~=1” to “>1”