A lot of cleanups and improvements by Walter de Jong