fix some build and coordinate bugs