Fixed various bugs
Fixed additional bugs and docs