Strip trailing whitespace
Add tests for get_plugins error conditions