Fixing broken functions