Several fixes requested by Thomas