Added restart and restartSync and fixed bugs in start and stop