r12440: fix crash bugs