Fix various bugs & typos