Fixed error with user-defined types