Yet another bug fix, hopefully final