Several fixes according to the reviewer's suggestions