Fixes, cleanups, improve exception handling and user messages.