Fix incorrect variable names.
Add type checking to the pipeline