Fixed a copy/paste error.
Added tests.