Fix schema for nonnull stuff. Fix rake task to use transaction.

Clean up tests.