Fix joint compilation issues

Against master as topic/enable has already incompatible changes. I propose to crate another branch from master and manually merge that PR to it.