Added checks for out dimensionality

Also, according tests