Fetched bugfixed Main and CatcherDetect from branch catchdetect