MD5 fix for issue #546 

Tested with a few queries, should be okay, lmk if i missed something.