Fixed grid on selection, small code cleanup.