ENH: fixed bug where leading gaps were being penalized, even when penalize_terminal_gaps == False