Fix clang warnings
tests: Fix out-of-bound read