Collection unit tests; bugfixing