Fix two accidental reversions
- The two fixes to patches: isheadless 1 px & type were accidentally
  overwritten in commit 3ecf4ad49e Pull Request: Fixed a variable in ...
- Added back in with this commit