Bug fixes applied.

Signed-off-by: portableant <dpett@britishmuseum.org>