misc fixes according to Ben's instruction