Minor changes and Documentation

Added minor changes ameliorating the code without affecting how it
works, and added documentation for godoc.