Fix a few minor problems with the code
Somehow those problems were only visible in specific compilation contexts, but nevertheless useful to address.
- missing
switch
fallback case where are return value was expected -
assert
checking an unsigned integer to be >= 0 - comparing unsigned integer to 0 (signed)