various bug fixes for _include functionality