Some corrections and cleanup