Logic/typo/other fixes