Added some bug fixes and file upload functionality.