fix search/replace gone wrong & comment formatting