DF-5503 minor corrections;
DF-5503 cleaned-up code a bit;
DF-5503 cleaned-up RHI code;