Remove warnings

- return value missing
- be explicit with storing a value in an if statement
- unsigned/signed mismatch