Addressing review comments and fixing unit tests