double checked that fix for #18 fixed #149 as well.
fix idle logic
merge from devel
scattered bug fixes