Fix some bugs in the inline refactory