Fixed bugs when intercepting packets