Further linear map fixes + unittests