Added empty lines check, removed some debug console calls