Various fixes to help get bash working