Various patches and improvements

I will fix this in the PR to incoming