[-] Fixed a bug that lead to an infinite loop & heap overflow in some situations