Fixed references. Lots of changes.