tidy warnings
extra array size check
extra shape test