Fixed errors in empirical_edit_cost