Fixed missing return statement in magic method calls and added test.