Improved beginning and ending of the shorting functionality as well as the ignoring case for matches