Strip whitespace on LMs, cleaned up logging