Hardening/some fixes