fixed a capitalization error in a query.
tidy up the path var in the theme function.