Fixes for r_db linkage