Remove trailing spaces from entity template