overall security cleanup and fixes