Fix two warnings found with Clang's undefined behaviour sanitizer