Various cleanup and tightening