Fixed list alignment after search

The bug removed all entries which were not found by search.
In finalize function, now original list is restored.
After the search, align is not executed (just write out input).
Fixed alignment after search