test and fix orbit detection