fixed various trivial, outstanding bugs