Further small code fixes and changes