Bug fixes
Second fix