Improve error detection for writes, similar to what's done for reads