very important fixes for bealign, including a fix for a major thinko in matrix initialization