Fix failing tests.
Merge pull request #170 from nla/upload_refine

Fix failing tests.