[FIX] AMCast
[ADD] Masoud's modifications