Fix for unit tests to not hang (from Devaraj Das)