fix assignment of lastVertex when building function type value