Wide ranging name changes and bug fixes