Bugfix routine