Several bug fixes.
Started expansion to second order.