Fix some bugs related by 'require'.