Make hamming conform to official definition

Closes #19