Added error messages to function/index parsing