additional bug fixes and style updates.
remove debug code.
Merge remote-tracking branch 'origin/master'