Fixed bug when opening files with too many lines

Changed the type of "lines" to unsigned long to allow the argument not
to break when opening files too long.