Training Large Language Models to be Better Rule Followers