Test branch

Merging source cleanup and Bug fixes.