Fixed unit test

Added a check to see if REMOTE_ADDR has been set.