Multiple commits

These changes include bug fixes, build configuration improvements, reformatted sources, code cleanup and documentation updates.