tests: fix warnings and potential failure