Either fixed bug or made one

Needs testing.