Address review comments.
Better repr test.
Add some type checking.