Weird html output of single_cat_title – is not inside of the html element?

By default single_cat_title(), a wrapper for single_term_title(), outputs the category name.
Try replacing that call with single_cat_title('',false).