Fix inverted conditions to detect writable or unwritable nodes