Fixing bug with elem value 0