Added db rollback to error
Fixed line endings