Fix for writes with sector sizes larger than 512 bytes