Problem with unstable Tilt Sensor [Too short pins]

I attached the photo of how I fixed both the switch and the potentiometer pins problem.
It requires some soldering. I know, it's not a beginner's task, but now them work perfectly!