FOCUS-4198 More fixes and better error reporting.