some corrections and cleanups