Improvements over tnse script.