Clean up models, fixed a bug.