Improved next functionality but bug persists.