Reapplying Cloud 9 changes from diff made by acemtp to 0.5.6