Fixes for some warnings that clang reports

Clang reports some warnings that I have fixed with this changes.

Some fixes are not ideal, especially about the overloaded+overrided virtual methods that may be confusing. The fix about unsigned being checked to `< 0` may be fixed by changing the type to signed integer instead, but I didn't know which way it was meant to be.