Prevent a warning when user agent is undefined

This fixes issue #6.