Handle non-existent theme path for php 5.2

Patch originally from: paulr
Closes #430