fix error in Deferred.when
add tests for Deferred.any