fixed a bug in TerminatorReceiveFilter that wrong prevMatched value used when calculate rest
Removed unused exception parameter
improved the build scripts