Cleanup; fix site locking mechanism; badtoken handling.