Fixed internal crashes (and overflow)