Bug fix from ages ago, remove commented code and extra code