Fix very subtle bug where promises wouldn't be returned by sync