minor cleanup and consistency check