Improved code formatting of Aml.
Removed dead code.
Fixed a few outdated unit tests.