Fixed minor bugs and updated documentation