bugfix: use rfind in pybcompgen