Fixed bug. type is returned as string always.