Support for grid view (fixes #20) plus some minor changes