simplify a bit the call of noKernel if only want stats
avoid unessecary error message when only computing stats
add comments, let caller close windows and simplify a bit