Added some small documentation and bug fixes