format fixes and minor changes to custom matching algorithm.