Fixed oveflow bugs, and probably add others =)