Code clean-up in platform agent to improve coverage

No changes at all in functionality. The coverage improved from 79% to 85% for the platform agent modules when running the platform agent specific tests (so actual coverage when running the whole test suite might be even better).