Fixed first() method, added debug option