Make the code more similar to the C version
Merge branch 'develop' of ssh://github.com/emmt/TiPi into develop