task manager fixes.

Thanks @Henry.T