build: Fix some warnings and clean up a bit