add_trailing_slashes now removes empty fields
Added newline for clarity and removed debug code