Still working on solutions that do not involve sleeping, but this will do for now. This commit was SVN r16824.