Fixed ref bug; basic support for listing bugs