Function for stripping out malicious bits