fix problems with optim_database_converter.py

also, change input from natoms to ndof.
fix returned distance in permutational aligment