Note that this found 2 bugs where errors were being silently ignored.
These are really simple fixes that didn't require much thought.
There are still more staticcheck warnings that should be fixed.
Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>