Added basic unit tests for the cxor module and bugfixes.