Fix: stop timer thread on error
fix masurca bug
Fix ins_size bug