Fix upgrade errors - see: http://redmine.encodedcc.org/issues/1618#note-11