Fixed write errors not bubbling up correctly