added upload, many small fixes, some related to #7 and #14, fix #9