Hopefully fixed bug.

Not particularly sure if this will work.