Protect calls from threading issues (#492)