Added more delegate methods
Fix a few bugs