Documentation, minor bug and style fixes.