Fix a possible race condition
Test with UNION (fails at runtime :/)
Use casts
Fix the vote