@Ryan, these is needed to make HEAD work in all situations

I have had send this to you but not marked, - I think you simply has not recognized these lines.