Small code and style fixes

Fix some warnings, a few comments. Nothing important.