Fixed file upload on linux, more bugfixes