Make last_modified method more reliable, so it doesn't cause an error in our error page when errors occur.