Fixing errors in the type of variable being used