Fixed bug with overflow.