Fix empty input test
Improve test code quality