fixed minor serialization error, added arbitrary instances for Foreign.