Fix some bugs and logging. Update the README