minor changes and a bug fix