Fixing bug with OS X Delay()