Safeguards against Triangle lib errors added