[MAINT] Fix miscellaneous compiler warnings.

As the title says. The fixes are done here and there and are by no means exhaustive.