Fixed a bug in the previous merge

Closing #1150