Add missing (int) typecasting for INTEGER primary and foreign keys. Add intval typecasting to values of arrays for INTEGER primary and foreign keys.