Small fixes and changes. The # of retries does not seems to be working properly yet