General cleanup - bug fix