Fix #522.

* Fix blatant mistake. Fixes #522.
* Properly complain when a profile specifies an unknown provider.