Bug fix from previous commits