Added basic trait encoding.