Manipulating show_on_front, page_on_front, page_for_posts and template hierarchy

Ok, got it working. I was returning a property of a serialized option within the callbacks for the filters:

add_filter('pre_option_page_on_front', 'page_on_front');
function page_on_front() {
    $options = get_option('theme_options');
    return $options['page_on_front'];
}
add_filter('pre_option_page_for_posts', 'page_for_posts');
function page_for_posts() {
    $options = get_option('theme_options');
    return $options['page_for_posts'];
}

The returend values were numbers, but strings. Typecasting them to int got it working.