fix bugs in sen3d_main