fix potential problem in setTraits; begin rewrite of filesystem