Fixed some things mentioned by scrutinizer.