stripApplicationPrefix: fix off by one in non-root applications