China probably sees the economic hamper that is North Korea. I think their tie with North Korea was just conveniant, although impersonal after Mao's death. China probably realizes that the Economic Situation in the Korean Peninsula could be more prosperous if an economic power house like South Korea joined with the north. I don't think China's interest is spreading the word of Communism anymore, I think it's about making money, and keeping it's current investments checked and balanced. If North Korea developed a Nuclear Weapon, China's economy would probably suffer from it.

As far as Russia goes, I think it's probably to warm up economic ties, probably for not only Russia designed weapons, but also Oil and Timber in Yakutsk and Siberia. If Separatist Movements started in Siberia, China could probably forget about having access to Siberia's vast timber and oil supplies. It's probably a joint Russian-Chinese pact to keep Siberia in line, just in case.