Remove isPromise from tests and fix _defer usage