Fixed master key handling problems.