fix case-incorrect requires (and some cleanup)