Unserialized Theme Variables and PHP Warning: array_merge Messages

I was receiving the following two errors and I thought taht they were related, but I had no idea how to approach solving them. =(

This first error seems happens intermittently when I load a page from a view and appears on the page when loaded and it has also appeared the admin modules page even though I have error displays off.

Notice: unserialize(): Error at offset 541 of 661 bytes in variable_initialize() (line 1174 of /includes/bootstrap.inc).

line 1174 is as follows:

$variables = array_map('unserialize', db_query('SELECT name, value FROM {variable}')->fetchAllKeyed());

These PHP errors are present in my Error Logs. I have errors not displayed.

Warning: array_merge(): Argument #2 is not an array in theme_get_setting() (line 1462 of /includes/theme.inc).
Warning: array_merge(): Argument #2 is not an array in theme_get_setting() (line 1462 of /includes/theme.inc).
Warning: array_merge(): Argument #2 is not an array in theme_get_setting() (line 1462 of /includes/theme.inc).
Warning: array_merge(): Argument #2 is not an array in theme_get_setting() (line 1462 of /includes/theme.inc).

I have tried resaving my theme settings and changing the theme and I still get the last set of errors at least. Line 1462 is as follows:

$cache[$theme] = array_merge($cache[$theme], variable_get('theme_' . $theme . '_settings', array()));

I did some research and tried the Variable Check Module (link below) which found one variable from the Seven admin theme and that may have been the culprit. I deleted it with that and it seems like it may have solved the problem.

Tags: