Remove debugging options from release version of program. Fix threading issues.