Add tests
Don't append tail if it is empty