Added spike and grounding detection