Improved cancelling and fixed scheduling duplicate jobs.