Add params to support soft_write_failure option as per Ken Barber

I can rebase these commits once the code is debugged and to your
liking.