Added back appropriate copyright notices.
Code fixes
Style fixes