Fixed file upload functional. Fixed few small errors.