fix some bugs of railgun