Added doctests, fixed representation allows complex scalars