Fixed issue with NetBSD's ls
Fixed coding style
Merge pull request #1531 from lcosmin/master

Fixed 'ls' issue on NetBSD