(Hopefully) fix #117 and capitaomorte/autopair#21