Missed pass-by-ref. Remove fix_prefix compatibility and use it through $db.

Signed-off-by: Norv <a.w.norv@gmail.com>
Fix buggy use of globals.

Signed-off-by: Norv <a.w.norv@gmail.com>