More fixes by @tivnet