Fixed error of aliasing object types with scope types, which resulted in segfaults.