Adding tests, and fixing an assignment bug