Various fixes etc.