Non square layouts fix

Fixes issue #12