Fix for the deluged-wait

This is a fix for waiting in issue #1 and #2