Yet another bug fix (untested code ftw)