Now all functions work properly.