lots of fixes to support rax usecase