fixed staging tests, improved cloudcode test, and minor bug fix