Remove not correct usage of retain and fix return statements