Cleanup some code to reduce warnings