fixed bug in hadamard reported by @ajgpitch

Fixes #257