Sentence:  Inside the stories usually <WSD>hewed</WSD> to a consistent formula: no matter how outlandish and weird the circumstances, in the end everything had to have a natural, if not plausible, ending—frequently, though not always, involving a mad scientist. 
Meaning of the word marked with <WSD> tags:  To act according to, to conform to; "usually construed with" (to).