Encoding element is optional
Fix getattr infinite loop
Fix Quality factory

The factory was incorrectly defined, but masked by the fact it was never getting the correct elements anyway.
Merge pull request #105 from daf/fix_swe_problems

Fix SWE problems