Added some tests of the catalogue module, and fixed a bug in the code.