Fix ClassCastException.
Fix problems with time auto update.