worked on CRM-12463, more cleanup
Merge pull request #626 from kurund/CRM-12463-fixes

worked on CRM-12463, more cleanup