more cleanup and preview fixes CRM-12963