Merge "Fix NanoSleep and add test"