Fixed crash when run without parameters

This protects against a crash caused by accessing the first parameter when no parameters are provided. Now displays an error message instead.