Fixing time functions