simulator: fixed setting the return address for trap functions