Essays on the political economy of elections