Fixed 2 bugs in functions.php