Fix #12766

@basepi, I need to manually fix this in 2014.1, don't cherrypick