Fixes some incorrect type issues mentioned by Scrutinizer.