Corrected layout generation

Unused matrix locations were causing problems in the layout - fixed by
defaulting to an empty action definition