bug fixes and consistency