Refactor tiles tests and fix some small issues