Don't display caption or credit section if empty.

Also fixed some pep8 issues.