patch against v3.5.4 based on discussion on https://awesome.naquadah.org/bugs/index.php?do=details&task_id=1249