Fixed trim_filter and normalize sub to properly remove white space