Cleanup sweep. Fixing potential logic bugs, etc.