Bugfixes in promise rewrite. Everything seems to work now.