backported some fixes done in qtSkeleton