It's all fixed upstream. Backported a combination of three patches. Signed-off-by: Rosen Penev <rosenp@gmail.com>