fixed restoring attrlib
various changes