Fix writer, more work on handlers/rules