Bug fix from Lars