A bit of documentation and fixes for unit test