Apply syohex's fix

Should fix #39