Fix wrong error message if non-function in head pos