Issue #181 fixed amr branch