[jmdb] Getting ref right