Fix Safe Mode on unclosed blocks