Update: repair stuff on trail registration
Improve: fix minor errors