Modified weight generation functions to allow singleton dimensions.

Also added missing tests to ensure these cases are working correctly.