General cleanup and fixing build warnings.