fix min args count check when uploading
fix npe when uploading without metadata.