Switched the order of submodule update and detaching head, as a result of internal non-breaking changes.