Make errors in functions more consistent

THIS IS AN INCOMPATIBLE CHANGE

Closes #95