Various bug fixes. Beginnings of asm to intrinsics port.