Test improvements and more documentation