Various code and documentation improvements

Change-Id: Id6a853b43f4a5e2df591d39be72ab861ae8c58e3