Expanded NCMatrix operations to handle empty matrices. Some bug fixes.