Multiple fixes and patches to get things working