fix completely broken apple garbage filter

subs will throw, when the string indices are out of bounds.