Fix typos leading to bugs