Fixes for functions.php

More details [here](https://bountify.co/simple-wordpress-theme-function-php-bug#answer_872).