MD5 fix for issue #546 

Tested with a few queries, should be okay, lmk if i missed something.
@gdrooid thanks for the heads up, in that case it'd probably be easier to do the single line replace you've got above!