Some logic changes.