various bug fixes and consistency updates