[MRG] Fix for #2835

CC: @arjoly