Fixed get type of FK
Fixed return value of objects without ID field