Changed pattern file loading: load from jar;
Some bug fixes