Partial fixes of issue #23.