Fix tests and handling of upload action