Fix bugs of #3