Fixed two cases that caused the AOI to get messed up.