Fixes for issues #26, #28 & #29 -- user agent sniffing