print_error should probably go to stderr..

Sort groups when read from config file.
Moved try/except for OSError into forloop so it could gracefully be caught.