Fix some remaining problems of issue #6