Fixed internal error when editing certain themes and epics

This fixes that themes and epics with children could
not be edited without getting Internal Server error during the
update after saving (the edit was saved anyway though).
Merge pull request #92 from fredrikpersson/update-item-fix

Fixed internal error when editing certain themes and epics