Better trimming JS.
Last sentence bug fix