Completed github issue #9
Also fixed issue with client IP address detection