Do not ever assume a function exists in plugin development. Always use if(has_action('action')){ #codetoHook }
and try not to modify or try to send headers before wp_head Hook ( Or i believe its wp_head anyways ).
Hope this helps!
http://rioranchowebsitedesign.com