Fix errors in find_by_dt/find_by_cls

Previously, the `find_by_*` methods were just broken. This pull request simply fixes them. I wasn't sure if I should return `None` or raise an exception when the item was found, but I guess `None` is less intrusive than throwing random exceptions.