Some doc and bug fixes