incorporate pull #2271
add more error handling
bring back function that broke all the tools and modes
more error handling for startup quirks