Several changes. SQL updated.