close #532, and some other small issues