Clean up some bad code errors and smells.