fix return in matrix/initialize for clean compile, added tests for return of correct type