Type check before using strip_tags.
Tidying up a few issues.