Fixes typos and turns invalid string into error