Minor cleanup and fixes in thm9