Modified async code to return values in call order, fixing several bugs as a result