Fixed another bug with trailing characters