Trace index fix

Fix for #488