Fixed levenshtein distance for empty sequences. Also, removed extraneous line from agent error handlers.