Some model and printing fixes for defined functions in input.