Improved bug fix