Fixed bug and documentation