Fixing logic bug in subMatrix method
Fixed some stuffs