Fix up assertions and make it clear the semantics of attr_readonly