Improved mmps-task API and fixed an issue with application hanging while
close