Multiple fixes to guardian and tests