Add complex type support. Mostly broken right now