Some bug fixes.

-- R. Ferdman, 11 September 2014