Various objective-c categories and improvements.