Added functions removeImpossibleMatches and fixGaps. Also fixed a bug in checkContinuous.