Changed documentation and fixed a bug