fixed some scrutinizer bugs, coding style issues, and unused code