Minor improvements and better documentation