Fixed issues with delay and program termination.