Don't use ctime on unix system. Cleanup check a bit. close #2904