Fixed some issues with restoring the background; added a neat little function to improve error output quality.