Violence, security threats cast pall over elections