Fixed undefined $directed in AbstractElement, various anomalies.