Various changes, fixes and typo