Better error checking

- Removed some unused code
- Changed start/stop scripts to block until finished