Bug fixes

Allow labels for training models to use more than just capped letters, but numbers and small letters as well.

Also fixed a bug with socket shutdown in finally, rather than in try. (shutdown() can fail too)