Fixes tests with promises