Logic is fixed now

Closes #840.