Fixed a bug with the kinds and added a test
Improved test