Fix notice errors that appear when WP_DEBUG is set to true