fixed avg transiton and model loading bugs reported by Didier Stevens