Patch to fix bug #15614

See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15614
and http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16702