Pre-merge
Merging fixes.
Added command-line flag for setting the GPU device number.