Fixed crash, additional memory usage optimization