remove retain/release for automatic memory mode and fix ambiguous boolean logic in if statements