Fixed bug in candidate creation