Added complex types tests and fixed inserting complex types