Improved overflow handling