Add checks for trailing spaces