Small bug fix

Small bug fix and added the BlockUntilDone method.