Added type check at attributes initialization