Fix SDL assertions and the SubRange template