Fix some logic
Fix typo