New option "Loop to region" selection crashed when no valid loop was selected. Just a NULL pointer check. Also: unified function declaration syntax, so it matches with rest of code.