Add readme and some bug fixes