Code cleanup
Fixed listing bugs