Fix #1 and pass test vectors