bugfix on calc_seq_energy