Fix bug#3936 in master