Bug fixes and update docs