Fixed bug in error message index