Fix block writing