Fix packet length error.
Fix mars cavern gen crash.