Small cleanups and fixes

Here is just a few small cleanups and fixes including:

- Avoiding comparison of `signed` and `unsigned` integer data types
- Avoiding comparison of `double` data types for equality (`!=` and `==`)
- Eliminating dead code path (comparing an `unsigned int` with `-1`)
- Adding default switch cases