For Issue 201. Also check that mutex allocation was successful, or panic.