bug fixes and schema update