Fix reload on preference change and cleanup.