Fixed working periods hang

Issues were hanging when no working periods are set. This is now fixed.