Fix tests and remove debug logging