This resolves the patch issues. If someone has time, they should try to get the patched merged upstream.