Loads of fixes. More error reporting. Attachment upload (hackish)