Revert removal of nil check as changes and unmanaged_files can ce nil.
Revert removal of the test for no hostname being given.
Revert removal of nil check for host as it can be nil.
Revert removal of the nil check for meta as meta can be nil.