config: Fix multiple trailing spaces before comments not completely trimmed
config: Add test cases that have trailing spaces before comment chars