agent: Eliminate the possible use of NULL pointer

Fixes #717
Closes #749
Signed-off-by: Stef Walter <stefw@redhat.com>
 * Rename test and cleanup whitespace