Fix for issue #56

Also changed utils.gethostname to utils.gethostbyname