Implemented compact method.

Fixed bug when enumerator yielded nil or false.