FREQUENCIES: Improve error message and coding style.