Improved error detection and handling

Added case insensitivity in group names
Added case for unknown groups
Added support for error messages