Fixed up amazon code after 2.10.0 upgrade and some modifications to handling optional data