Continued updates

Noticed that WIP commits from my fork was cherry-picked so here comes
the missing part.