From Vladimir Chebeav, fix for removal of nested callbacks