Improvements to tailing logic