Fixed PhantomAsPromise and added a simple test