Removing function errors due to type mismatches