bug fixes for amr.