File upload fixes #21 and #22