More qsim fixes.