Bugfixes and finished patching tool