Fix createSubBuffer + argument validation