Bugs/improve opal upload

This fixes multiple open issues with opal_upload. Hopefully they are all done now.