Multiple typo and bug fixes

Fixes are in the commits