make sure we dont try to remove more processes than 0 - fixes #429
small api example