Cleaning up upstream tests

I don't think I made any meaningful changes to code, but please review :)