Fixing bugs

Fixing bugs, update docs