Added a workaround for Chrome promise bugs.