Fixing attempt to commit beyond the last entry