fix comments not being removed and some logging formatting