Aml bug fix and slight optimization.
Lun optimization (I think).