Fixed a bug where returns from a closure in a queue caused an exception.