fixing some CPSR Z flag issues

also some cleanup