Fixed warnings/fatal errors/return value problems/style.
Wired up facets.