Fixed Null socket on quit. Testing further
Fixed few bugs in Rule matching. Still needs more testing for robustness