Properly handle preferences and tweak error reporting.