Fixed delays and added some debug options