Fixed selection problem with using `resid` (Issue #160).