Some fixes. TODO: Fix initialize stack overflow