various sequence handling fixes