More cleanup and fixes