Fix jasmin tests

cherry pick commits
322c8ffbe27aa640ab7455a998d094c48d854f22
adba6e1c859c92c034182ee0d7034bb7f22331ec

fix #473