Fixes #363 Invalid cast exception
Fixed problem publishing (fixes #366)
Merge branch 'master' of github.com:n2cms/n2cms
Merge pull request #364 from petedavis/Issue_363

Fixes #363 Invalid cast exception
Merge branch 'master' of https://github.com/n2cms/n2cms