Fix scoping bugs in #find / #find_by_id