Partial fix of upload, add pong and close.