Fix status code from being sent as part of body.
Fix incorrect permissioning on directory creation.