Fix profile index

Fixes issue #51. See there for details. :)