Bugfix
Clean up promise-related code