minor corrections and tests