Added error exceptions when nanosleep fails. Also made some review changes.