Fixed alignUngapped and extendMatch so that the first loop of extendMatch extends the match the same distance as in the C++ code