Minor code adjustments/optimizations.

Signed-off-by: Nigel <Nigel@10.203.4.182>