Added support for AE and bug fixes