various corrections and clean up