Fix the euclidean function so that its gradients don't become nan. Also moves the bytes_to_human function