Fixed re-loading of pattern data. Also changed program so it will not exit when pattern detection fails