added tests for hamming distance. Solved bug in NA handling