Add test. Minor bugfix