Added a -d flag that supports targeting a specific device. Also some administrative improvements