Added error message to freq_box
Added some useful utility functions.