Trim exceptions in the correct places