Fix bug mentioned in #2