Trend test + bugfixes
bugfix + wrong thread processing