fixed again issue 1630:memdb id error -- tries casting None to long.