Fixed zero-indexing-related bug in server