Thanks dj.facebook at gmail.com for the report and initial patch and Areski Belaid and senko for improvements.